<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>培训管理</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="refresh" content="1200">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link rel="stylesheet" href="/dist/plugins/fixedTable/fixed-table.css"/>
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=39cd89cd">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        [v-cloak] {
            display: none;
        }

        .table > tbody > tr > td {
            height: 24px;
            max-height: 24px;
            overflow: hidden;
            position: relative;
        }

        .nav-tabs-custom {
            margin-bottom: 0;
            box-shadow: none;
            position: relative;
        }

        span.lineOne {
            line-height: 27px !important;
            height: 28px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .table-detail td.twoLine {
            line-height: 1.5 !important;
            padding: 3px 0 !important;
        "
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .table-detail select {
            text-indent: 0 !important;
            padding-left: 0 !important;
            margin-left: -4px !important;
        }

        .fixed-table_body tr td {
            border-right: none;
            font-size: 12px;
            text-align: center;
        }

        .fixed-table_header tr th {
            border-right: none;
            background: yellow;
            font-weight: normal;
            font-size: 12px;
        }

        .fixed-table_body tr:nth-of-type(odd) {
            background: #F9F9F9;
        }

        .gray td {
            color: #CCCCCC !important;
        }

        .slide-box {
            display: -webkit-box;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
            height: 34px;
            line-height: 34px;
            background: #2a8cec;
            width: 100%;
            padding-left: 5px;
        }

        .rights {
            text-align: center;
            color: #fff;
            font-size: 14px;
            /* border-bottom: 2px solid #f8f8f8; */
            margin-left: 4px;
            margin-right: 4px;
            margin-top: 3px;
            padding-bottom: 5px;
            cursor: pointer;
        }

        .lefts {
            text-align: center;
            color: #2a8cec;
            background-image: url(/dist/img/tabApp.png);
            margin-left: 8px;
            margin-right: 8px;
            background-size: 100% 100%;
            padding: 4px 15px 15px;
        }

        .templateStyle {
            margin-top: 10px;
        }
        .content {
            padding: 8px 8px 0 8px;
        }
    </style>
</head>
<body>
<section class="content" id="app" v-cloak>
    <div class="oaLoad">
        <div class="loadGif" id="areaProgress"></div>
    </div>
    <div class="div-td-content-more"><i></i></div>
    <div class="nav-tabs-custom oaReportNav">
        <div style="height: 25px; margin-bottom: 10px;">
            <input type="text" placeholder="关键字" class="form-control pull-left input-sm"
                   style="width: 200px; " v-model="searchParams.key" id="txtParent">
            <button type="button" class="btn oaBtn btn-sm pull-left"
                    style="margin-left: 10px;min-width:10px;width:50px;" @click="search">
                查询
            </button>
            <input type="button" value="新增培训" class="btn oaBtn btn-sm pull-right" @click="add()"
                   style="min-width:10px;">
        </div>

    </div>
    <div class="box-body no-padding iframeH3" style="overflow: auto;" id="scrollDiv">
        <div id="progress" class="wyui-progress"></div>
        <div class="fixed-table-box head-fixed ">
            <div class="fixed-table_header-wraper">
                <table class="fixed-table_header" cellspacing="0" cellpadding="0" border="0">
                    <thead>
                    <tr>
                        <th style="width:50px;">
                            <div class="table-cells">序号</div>
                        </th>
                        <th>
                            <div class="table-cells">培训内容</div>
                        </th>
                        <th style="width:80px;">
                            <div class="table-cells">培训人数</div>
                        </th>
                        <th style="width:80px;">
                            <div class="table-cells">已通过人数</div>
                        </th>
                        <th style="width:80px;">
                            <div class="table-cells">未通过人数</div>
                        </th>
                        <th style="width:80px;">
                            <div class="table-cells">未作答人数</div>
                        </th>
                        <th style="width:80px;">
                            <div class="table-cells">创建人</div>
                        </th>
                        <th style="width:100px;">
                            <div class="table-cells">创建时间</div>
                        </th>
                        <th style="width:100px;">
                            <div class="table-cells">截止时间</div>
                        </th>
                        <!--<th style="width:80px;">
                            <div class="table-cells">培训剩余天数</div>
                        </th>-->
                        <!-- <th style="width:70px;">
                             <div class="table-cells">培训状态</div>
                         </th>-->
                        <th style="width:100px;">
                            <div class="table-cells">状态</div>
                        </th>
                        <th style="width:100px;">
                            <div class="table-cells">操作</div>
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
            <div class="fixed-table_body-wraper iframeFixed">
                <table class="fixed-table_body table-hover" cellspacing="0" cellpadding="0" border="0"
                       style="width: 100%;">
                    <tbody>
                    <template v-if="list.main.length>0">
                        <tr v-for="(item,i) in list.main">
                            <td style="width:50px;">{{i+1}}</td>
                            <td @click="chaKan(item)" style="text-align: left;">
                                <span style="text-align: left">{{item.description}}</span>
                            </td>
                            <td style="width:80px;cursor: pointer;color: #2a8cec;" @click="getUserByType(item,0)"
                                v-if="item.allCount!=0">
                                {{item.allCount}}
                            </td>
                            <td style="width:80px;" v-else>
                                {{item.allCount}}
                            </td>
                            <td style="width:80px;cursor: pointer;color: #2a8cec;" @click="getUserByType(item,1)"
                                v-if="item.passCount!=0">
                                {{item.passCount}}
                            </td>
                            <td style="width:80px;" v-else>
                                {{item.passCount}}
                            </td>
                            <td style="width:80px;cursor: pointer;color: #2a8cec;" @click="getUserByType(item,2)"
                                v-if="item.unPassCount!=0">
                                {{item.unPassCount}}
                            </td>
                            <td style="width:80px;" v-else>
                                {{item.unPassCount}}
                            </td>
                            <td style="width:80px;cursor: pointer;color: #2a8cec;" @click="getUserByType(item,3)"
                                v-if="item.allCount-item.passCount-item.unPassCount!=0">
                                {{item.noAnswer}}
                            </td>
                            <td style="width:80px;" v-else>
                                {{item.allCount-item.passCount-item.unPassCount}}
                            </td>
                            <td style="width:80px;"><span class="oa-name">{{item.createUserName}}</span></td>
                            <td style="width:100px;">{{timeSub(item.createTime)}}</td>
                            <td style="width:100px;">{{timeSub(item.endTime)}}</td>

                            <!--<td style="width:80px;">{{haveTime(item)=='已截止'?'0':haveTime(item)}}</td>-->
                            <!--<td :style="pxState(item)=='逾期'?'color :red;width:70px;':'width:70px;'">{{pxState(item)}}
                            </td>-->
                            <td style="width:100px;" v-html="stateTO(item)"></td>
                            <td style="width:100px;">
                                <a href="javascript:void(0);" v-if="item.currentAuditorId == userId&&item.auditFlag==0"
                                   @click="shenHe(item)"
                                   style="">&nbsp;审核&nbsp;</a>
                                <a href="javascript:void(0);"
                                   v-if="(item.createUserId == userId&&item.auditFlag!=0&&item.auditFlag!=1)||(item.createUserId==''&&copier.indexOf(userId)!=-1)"
                                   @click="bianJi(item)">&nbsp;编辑&nbsp;</a>
                                <!--<template v-if="item.needPX==1">
                                    <a href="javascript:void(0);" v-if="item.auditFlag==1&&item.passFlag==0"
                                       style="color:#2a8cec;cursor: pointer;text-align: center;" @click="goKaoShi(item)">&nbsp;开始&nbsp;
                                    </a>
                                    <a v-if="item.auditFlag==1&&item.passFlag==1" href="javascript:void(0);"
                                       style="color:#2a8cec;cursor: pointer;text-align: center;" @click="goKaoShi(item)">&nbsp;查看&nbsp;
                                    </a>
                                    <a v-if="item.auditFlag!=1&&item.auditFlag!=-1" href="javascript:void(0);"
                                       style="color:#2a8cec;cursor: pointer;text-align: center;" @click="chaKan(item)">&nbsp;查看&nbsp;
                                    </a>
                                </template>
                                <template v-else>
                                    <a   href="javascript:void(0);"
                                         style="color:#2a8cec;cursor: pointer;text-align: center;" @click="chaKan(item)" v-if="item.auditFlag!=-1">&nbsp;查看&nbsp;
                                    </a>
                                </template>-->

                                <span v-if="item.auditFlag == 1&&item.passFlag == 1 && item.needPX == 1&&item.unNeedPX!=1"
                                      style="color:#2a8cec;cursor: pointer;text-align: center;" @click="goKaoShi(item)">&nbsp;查看&nbsp;</span>

                                <span v-if="(item.auditFlag != -1&&item.unNeedPX==1)||(copier.indexOf(userId)!=-1)"
                                      style="color:#2a8cec;cursor: pointer;text-align: center;" @click="chaKan(item)">&nbsp;查看&nbsp;</span>

                                <span v-if="item.auditFlag==1&&item.needPX==1&&item.passFlag==0"
                                      style="color:#2a8cec;cursor: pointer;text-align: center;" @click="goKaoShi(item)">&nbsp;开始&nbsp;
                                 </span>
                                <a href="javascript:void(0);" @click="deleteMain(item)"
                                   v-if="item.auditFlag==-1&&item.createUserId==userId">
                                    删除
                                </a>
                            </td>
                        </tr>
                    </template>

                    <tr v-else>
                        <td colspan="10" tyle="width:50px;">暂无培训内容</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <!--<div @click="showTk(1)">答题成功</div>-->
        <!--<div @click="showTk(2)">答题失败</div>-->
    </div>

    <div class="oa-pager text-center" style="margin-top: 5px;">
        共
        <span id="allCount"> 0 </span>条记录&nbsp;&nbsp;&nbsp;
        <span id="nowPage"> 1 </span>/<span id="allPage">1</span>&nbsp;&nbsp;&nbsp;
        <span class="oa-pager-button" id="first">首页</span>
        <span class="oa-pager-button" id="prev">上一页</span>
        <span class="oa-pager-button" id="next">下一页</span>
        <span class="oa-pager-button" id="last">尾页</span>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=558d0414"></script>

<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script src="/dist/plugins/fixedTable/fixed-table.js"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne", ".lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + 12 + "px",
                        "left": $(this).offset().left - 6,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script type="text/javascript">
    function refresh() {
        $.wyui.page.getByPage();
       //培训管理红点提示
        top.getRedHot();
    }

    var app = new Vue({
            el: '#app',
            data: {
                copier:"2017121616084F0B9E200AC4144BD435,2017121616304595BB1D12C91392E04E,20190218105344E3AB019AC329256BF9,20171217130247059F2B10DB2BE1B5C7,2019040810014F6DB3395FF3674DFCE3",
                userId: getCurrentUser().id,
                currentUser: getCurrentUser(),
                rightOp: [],//权限列表
                list: {
                    main: [],
                },
                selectCompany: 0,
                searchParams: {
                    userId: $.wyui.page.urlParams.userId ? $.wyui.page.urlParams.userId : getCurrentUser().id,
                    key: '',
                    noLoad: true,
                },
            },

            methods: {
                showTk: function (type) {
                    if (type == '1') {
                        top.$.alert({
                            win: this,
                            height: 200,
                            icon: '1', //1成功 2失败 3提示 不穿代表无图标
                            title: '恭喜您，培训通过！',
                            content: '',

                            blankclose: true,//点击空白是否可关闭
                            ok: "确定",//是否显示确认按钮,
                            okCallback: function () {
                                //确认按钮回调
                                console.log("确定回调")
                                console.log(this.win.myWorkList)
                            }
                        })
                    }
                    if (type == '2') {
                        var txt = "很遗憾，您未通过培训！";
                        top.$.alert({
                            win: this,
                            height: 320,
                            icon: '5', //1成功 2失败 3提示 不穿代表无图标
                            title: '请仔细阅读培训材料，再接在励哦',
                            content: '<p>' + txt + '</p>',

                            blankclose: true,//点击空白是否可关闭
                            ok: "再次测试",//是否显示确认按钮,
                            okCallback: function () {
                                //确认按钮回调
                                console.log(this)
                                console.log("确定回调")
                                console.log(this.win.myWorkList)
                            },
                            cancel: "退出"
                        })
                    }
                },
                timeSub: function (time) {
                    if (time) {
                        return new Date(time).Format(TimeFormat.pcList)
                    } else {
                        return '';
                    }
                },
                deleteMain: function (item) {

                    top.$.alert({
                        win: this,
                        height: 180,
                        width: 300,
                        icon: '3', //1成功 2失败 3提示 不穿代表无图标
                        title: '确定要删除吗？',
                        blankclose: true,//点击空白是否可关闭
                        ok: "通过",//是否显示确认按钮,
                        okCallback: function (em, opts) {
                            //确认按钮回调
                            em.remove()
                            opts.close && opts.close()
                            $.wyui.postMethod("/exam/deleteMain.json", {
                                id: item.id,
                            }, function (r) {
                                top.$.alert({
                                    win: this,
                                    height: 180,
                                    width: 300,
                                    icon: '1', //1成功 2失败 3提示 不穿代表无图标
                                    title: "删除成功！",
                                    content: '',
                                    blankclose: false,//点击空白是否可关闭
                                    cancel: "确定",
                                    cancelCallback: function (em, opts) {
                                        em.remove()
                                        opts.close && opts.close()
                                        top.refreshTabByName("培训管理", "no");
                                    }
                                })
                            });
                        },
                        cancel: "取消",
                        cancelCallback: function (em, opts) {
                            em.remove()
                            opts.close && opts.close()
                        }
                    })
                },
                deleteLeaveUser: function () {
                    var that = this;
                    that.getList1();
                }
                ,
                pxState: function (item) {
                    var that = this;
                    if (item.auditFlag != 1) {
                        return '';
                    }
                    if (item.state != 1) {
                        return '未发布';
                    }
                    var str = that.haveTime(item);

                    if (item.createUserId == getCurrentUser().id || item.needPX == 0) {
                        if (str == '已截止') {
                            return '逾期';
                        } else {
                            return '考核中';
                        }
                    } else {
                        if (item.passFlag == 1) {
                            return '已通过';
                        } else {
                            if (str == '已截止') {
                                return '逾期';
                            } else {
                                return '未通过';
                            }
                        }
                    }
                }
                ,
                shenHe: function (item) {
                    var that = this;
//                    var $iframe = top.findIframeByName("个人主页");
//                    $iframe[0].contentWindow.$('[attr-hongDian="培训管理"]').remove(".hongDian")
//                    console.log($iframe[0].contentWindow.$('[attr-hongDian="培训管理"]'))
                    top.closeTabByPageId("xzpx");
                    var title = '审核培训';
                    top.addTabs({
                        id: 'xzpx',
                        title: title,
                        close: true,
                        url: 'exam/tempExamDetail.html?isAdd=0&pageType=look&id=' + item.id
                    });


                }
                ,
                stateTO: function (item) {
                    var that = this;
                    var state = '';
                    switch (item.auditFlag) {
                        case "-1":
                        case -1:
                            state = "未提交";
                            break;
                        case "0":
                        case 0:
                            if (item.currentAuditorId == getCurrentUser().id) {
                                state = "<span style='color:red;'>待-" + item.currentAuditorName + "-审核</span>";
                            } else {
                                state = "待-" + item.currentAuditorName + "-审核";
                            }
                            break;
                        case "1":
                        case 1:
                            state = "已通过";
                            break;
                        case "2":
                        case 2:
                            if (item.createUserId == getCurrentUser().id) {
                                state = "<span style='color:red;'>已驳回</span>";
                            } else {
                                state = "已驳回";
                            }
                            break;
                    }
                    var state1 = '';
                    var str = that.haveTime(item);
                    if (state == '已通过') {
                        if (item.needPX == 1) {
                            if (item.passFlag == 0) {
                                if (str == '已截止') {
                                    state1 = "<span style='color:red;'>已逾期</span>";
                                } else {
                                    state1 = '未通过';
                                }
                            } else {
                                state1 = '已通过';
                            }
                        } else {
                            if (str == '已截止') {
                                state1 = '已结束';
                            } else {
                                state1 = '考核中';
                            }
                        }
                    } else {
                        state1 = state;
                    }
                    return state1;
                }
                ,
                haveTime: function (item) {
                    var diff = new Date(item.endTime).getTime() - new Date().getTime();//时间差的毫秒数

                    //计算出相差天数
                    var days = Math.floor(diff / (24 * 3600 * 1000));

                    //计算出小时数
                    var leave1 = diff % (24 * 3600 * 1000);    //计算天数后剩余的毫秒数
                    var hours = Math.floor(leave1 / (3600 * 1000));
                    //计算相差分钟数
                    var leave2 = leave1 % (3600 * 1000);        //计算小时数后剩余的毫秒数
                    var minutes = Math.floor(leave2 / (60 * 1000));

                    //计算相差秒7数
                    var leave3 = leave2 % (60 * 1000);      //计算分钟数后剩余的毫秒数
                    var seconds = Math.round(leave3 / 1000);

                    var returnStr = "";
                    if (days > 0) {
                        returnStr = days + "" + returnStr;
                    } else {
                        returnStr = "0" + returnStr;
                    }
                    if (hours >= 0) {
                        if (hours == 0 && minutes < 0) {
                            return "已截止"
                        }
                    } else {
                        return "已截止"
                    }
                    return returnStr;
                }
                ,
                search: function () {
                    $.wyui.page.queryParams.requestPage = 1;
                    $.extend($.wyui.page.queryParams, trimRN(this.searchParams));
                    $.wyui.page.getByPage();
                }
                ,
                add: function () {
                    top.closeTabByPageId("xzpx");
                    top.addTabs({id: 'xzpx', title: '新增培训', close: true, url: 'exam/tempExamDetail.html?isAdd=1'});
                }
                ,
                getList1: function () {
                    $.wyui.page.dataUrl = server.ip + "/exam/getExamList.json";
                    $.extend($.wyui.page.queryParams, trimRN(this.searchParams));
                    //$.wyui.page.getByPage();

                }
                ,
                isHasRightOp: function (eName) {
                    return $.inArray(eName, this.rightOp) > -1;
                }
                ,
                isShowBtn: function (eName) {
                    if (getCurrentUser().superUser || this.isHasRightOp(eName)) {
                        return true;
                    } else {
                        return false;
                    }
                }
                ,
                chaKan: function (item) {
                    if (item.unNeedPX == 1) {
                        top.closeTabByPageId("xzpx");
                        var title = '查看培训';
                        top.addTabs({
                            id: 'xzpx',
                            title: title,
                            close: true,
                            url: 'exam/tempExamDetail.html?isAdd=0&pageType=look&id=' + item.id+"&isExit=1"
                        });
                    } else {
                        return false;
                    }
                }
                ,
                bianJi: function (item) {
                    top.closeTabByPageId("xzpx");
                    top.closeTabByPageId("ydst");
                    top.closeTabByPageId("xzpxst");
                    var title = '编辑培训';
                    top.addTabs({
                        id: 'xzpx',
                        title: title,
                        close: true,
                        url: 'exam/tempExamDetail.html?isAdd=0&pageType=edit&id=' + item.id
                    });
                }
                ,
                goKaoShi: function (item) {
                    top.closeTabByPageId("ydst");
                    top.closeTabByPageId("xzpxst");
                    top.addTabs({
                        id: 'ydst',
                        title: '阅读材料',
                        close: true,
                        url: 'exam/look.html?id=' + item.id + '&passFlag=' + item.passFlag,
                    });
                }
                ,
                getUserByType: function (item, type) {
                    var that = this;
                    var examState = '';

                    var str = that.haveTime(item);
                    if (str == '已截止') {
                        examState = '逾期';
                    } else {
                        examState = '未逾期';
                    }
                    //0  全部考试人员
                    //1  考试通过人员
                    //2  未通过人员
                    //3  逾期人员
                    var title = '';
                    switch (type) {
                        case  0:
                            title = '培训人员'
                            break;
                        case  1:
                            title = '已通过人员'
                            break;
                        case  2:
                            title = '未通过人数'
                            break;
                        case  3:
                            title = '未作答人数'
                            break;
                    }
                    //不要标题了
                    title = '';
                    top.$.dialog({
                        content: 'url:exam/tempExamUserList.html?id=' + item.id + '&userType=' + type + '&examState=' + examState,
                        title: title,
                        width: 500,
                        height: 475,
                        max: true,
                        min: true,
                        lock: true
                    });
                }
                ,
            },
            mounted: function () {
                var that = this;
                that.deleteLeaveUser();


            }
        })
    ;
    $.wyui.page.getByPage_callback = function (r) {
        app.list.main = r;
        console.log(app.list.main.length)
        document.getElementById("scrollDiv").scrollTop = 0;
    };
    $.wyui.page.getByPage_scroll_callback = function (list) {
        if (list.length < 30) {
            isLoad = false;
        } else {
            for (var i = 0; i < list.length; i++) {
                app.list.push(list[i]);
            }
            isLoad = true;
        }
    };
    $(function () {
        $("#txtParent").autoComplete({
            url: server.ip + urlConfig.contract.getContractBuyer,
            render: function (r, panel) {
                for (var i = 0; i < r.length; i++) {
                    $("<li></li>").data("autoComplete",
                        r[i]).html("<a>" + r[i].customerName + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + r[i].customerTel + ") " + "</a>")
                        .appendTo(panel);
                }
            },
            selected: function (r) {
                app.searchParams.key = r.customerName;
                return false;
            },
            extraParams: {createUserId: getCurrentUser().id},
            height: 210,
            width: 300
        })

    });
</script>
<script>
    //初始化FixedTable
    $(".fixed-table-box").fixedTable();
</script>
</body>
</html>